package com.ruoyi.system.designpattern.visitor;

// 具体元素：书籍
public class Book implements Element {
    private String name;
    private double price;
    private int stock;
    
    public Book(String name, double price, int stock) {
        this.name = name;
        this.price = price;
        this.stock = stock;
    }
    
    public String getName() {
        return name;
    }
    
    public double getPrice() {
        return price;
    }
    
    public int getStock() {
        return stock;
    }
    
    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
